#include<stdio.h>


// 进制数转换器
int main()
{
	int sum = 0;
	int x = 1, y = 1;
	int i = 0;
	int k = 0;
	int n = 0;
	printf("请输入转换的进制位数(2/8):");
	scanf("%d", &n);
	printf("请输入转换数：");
	scanf("%d", &k);
	i = k;
	while (i != 0)
	{
		y = i % n;
		sum += x * y;
		x *= 10;
		i /= n;
	}
	printf("数%d的%d进制为%d", k,n, sum);
	return 0;
}